﻿using System.ComponentModel;
using Kugar.Web.Wechat.Serializers;
using Newtonsoft.Json;

namespace Kugar.Web.Wechat.Entities
{
    [JsonConverter(typeof(WeixinMenuNewtonsoftJsonSerializer))]
    public class WeixinMenuConfigItem
    {
        public string Title { set; get; }

        public string Value { set; get; }

        public WeiXinMenuItemTypeEnum Type { set; get; }
    }

    [JsonConverter(typeof(WeixinMenuNewtonsoftJsonSerializer))]
    public class WeixinMenuRoot : WeixinMenuConfigItem
    {
        public WeixinMenuConfigItem[] ChildMenus { set; get; }
    }

    /// <summary>
    /// 微信菜单事件
    /// </summary>
    public enum WeiXinMenuItemTypeEnum
    {
        /// <summary>
        /// 点击事件
        /// </summary>
        [Description("点击事件")]
        Click = 1,

        /// <summary>
        /// 访问网页
        /// </summary>
        [Description("访问网页")]
        ViewWeb = 2,

        /// <summary>
        /// 地理位置选择
        /// </summary>
        [Description("地理位置选择")]
        LocationSelector = 3,

        /// <summary>
        /// 选择照片或相册
        /// </summary>
        [Description("选择照片或相册")]
        PhotoOrAlbumn = 4,

        /// <summary>
        /// 系统拍照
        /// </summary>
        [Description("系统拍照")]
        SystemCamera = 5,

        /// <summary>
        /// 微信相册
        /// </summary>
        [Description("微信相册")]
        WechatAlbum = 6,

        /// <summary>
        /// 扫码事件
        /// </summary>
        [Description("扫码事件")]
        ScanQrcode = 7,

        /// <summary>
        /// 扫码并等待
        /// </summary>
        [Description("扫码并等待")]
        ScanQrcodeAndWait = 8
    }
}
